package com.gzc.pm.enum 
{
	import mx.collections.ArrayCollection;

	[Bindable]
	public class OrientationModeEnum
	{
		public function OrientationModeEnum(value:int=0, name:String="")
		{
			this.value = value;
			this.name = name;
		}
		
		public var name:String;
		public var value:int;
		
		public static const ORIENTATION_MODE_1:OrientationModeEnum = new OrientationModeEnum(1, '两顶尖');
		public static const ORIENTATION_MODE_2:OrientationModeEnum = new OrientationModeEnum(2, '两顶尖+跟刀架');
		public static const ORIENTATION_MODE_3:OrientationModeEnum = new OrientationModeEnum(3, '卡盘+顶尖');
		public static const ORIENTATION_MODE_4:OrientationModeEnum = new OrientationModeEnum(4, '三爪卡盘');
		public static const ORIENTATION_MODE_5:OrientationModeEnum = new OrientationModeEnum(5, '四爪卡盘');
		public static const ORIENTATION_MODE_6:OrientationModeEnum = new OrientationModeEnum(6, '卡盘+顶尖+跟刀架');
		public static const ORIENTATION_MODE_7:OrientationModeEnum = new OrientationModeEnum(7, '弹簧心轴');
		
		public static var ALL:ArrayCollection = new ArrayCollection([ORIENTATION_MODE_1,ORIENTATION_MODE_2,
			ORIENTATION_MODE_3,ORIENTATION_MODE_4,ORIENTATION_MODE_5,ORIENTATION_MODE_6,ORIENTATION_MODE_7]);
		
		public static function getItemByValue(v:int):OrientationModeEnum{
			var item:OrientationModeEnum;
			for each(var mode:OrientationModeEnum in ALL){
				if(mode.value == v){
					item = mode;
				}
			}
			return item;
		}
		
	}
}